package com.navid.trafalgar.games;

import com.jme3.app.Application;
import com.jme3.app.state.AbstractAppState;
import com.jme3.app.state.AppStateManager;
import com.jme3.system.AppSettings;
import de.lessvoid.nifty.Nifty;
import de.lessvoid.nifty.screen.Screen;
import de.lessvoid.nifty.screen.ScreenController;

/**
 *
 */
public class MyStartScreen extends AbstractAppState implements ScreenController {

  private Nifty nifty;
  private Application app;
  private Screen screen;
    private final AppSettings settings;

  

    MyStartScreen(AppSettings settings, Application app) {
        this.settings = settings;
        this.app = app;
    }


  public void startGame(String nextScreen) {
    nifty.gotoScreen(nextScreen);  // switch to another screen
//      Millestone2 millestoneScreen2 = new Millestone2(settings);
//      app.getStateManager().detach(this);
//      app.getStateManager().attach(millestoneScreen2);
  }

  public void quitGame() {
    app.stop();
  }

  public String getPlayerName() {
    return System.getProperty("user.name");
  }

  /** Nifty GUI ScreenControl methods */
  public void bind(Nifty nifty, Screen screen) {
    this.nifty = nifty;
    this.screen = screen;
  }

  public void onStartScreen() {
  }

  public void onEndScreen() {
  }

  /** jME3 AppState methods */
  @Override
  public void initialize(AppStateManager stateManager, Application app) {
    this.app = app;
  }

  @Override
  public void update(float tpf) {
      
  }
}
